package com.study.consumer;

import com.study.api.OrderService;
import com.study.api.UserService;
import com.study.model.Order;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.Method;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: luobiao
 * @Date: 2021/4/26 08:17
 * @Description:
 */
@RestController
@RequestMapping("order")
public class OrderController {
    @DubboReference()
    private OrderService orderService;

    @DubboReference()
    private UserService userService;

    /**
     * http://localhost:8081/order/detail?dubbo.tag=tag1
     * @return
     */
    @GetMapping("detail")
    public String index(){
        Order order = orderService.getOrder(1L);
        userService.getUserList();
        return order.toString();
    }
}
